function comment_form_init(){
            if (window.attachSubmitEvent){
                attachSubmitEvent($('#comment_form form'), comment_form_init, null, 'comment_form');
            }
        }
function recommend_form_init(){
            if (window.attachSubmitEvent){
                attachSubmitEvent($('#recommend_form form'), recommend_form_init, null, 'recommend_form');
            }
        }
function favorite_form_init(){
    if (window.attachSubmitEvent){
       attachSubmitEvent($('#add_to_favorite_form_id'), favorite_form_init, null, 'add_to_favorite_form_wrapper');
    }
}

function rate_form_init(){
    $('.hover-star').rating({
      callback:function(value, link){
          $("#content_rate_post_form input[name=rate]").val(value);
          $("#content_rate_post_form").trigger('submit');
      }
    });
    if (window.attachSubmitEvent){
       attachSubmitEvent($('#content_rate_post_form'), rate_form_init, null, 'content_rate_form_wrapper');
    }
}
$(document).ready(function(){
	$('#comment_add_title').bind('click', function(event){
            $('#comment_form').slideToggle('slow');
            return false;
	});
        $('#recommend_to_friend').bind('click', function(event){
            $('#recommend_form').slideToggle('slow');
            return false;
	});
        $('#rated_content_title').bind('click', function(event){
            $('#rated_content_form').slideToggle('slow');
            return false;
	});
        $('#commented_content_add_title').bind('click', function(event){
            $('#commented_content_form').slideToggle('slow');
            return false;
	});

        comment_form_init();
        recommend_form_init();
        favorite_form_init();
        rate_form_init();
        
});